<?php

  //to do: improve the way to pass two or more parameters in the paged-table ( link )

  $aux = explode ( '|', $_GET['id'] );
  $index=0;
  $JobtitleUid = str_replace ( '"', '', $aux[$index++] );

  require_once ( PATH_PLUGINS . 'hr' . PATH_SEP . 'class.hr.php');
  $pluginObj = new hrClass ();

  require_once ( "classes/model/HrJobsTitles.php" );
  //if exists the row in the database propel will update it, otherwise will insert.
  $tr = HrJobsTitlesPeer::retrieveByPK( $JobtitleUid  );

  if ( ( is_object ( $tr ) &&  get_class ($tr) == 'HrJobsTitles' ) ) { 
     $fields['JOBTITLE_UID'] = $tr->getJobtitleUid();
     $fields['LABEL_JOBTITLE_UID'] = $tr->getJobtitleUid();
     $fields['JOBTITLE'] = $tr->getJobtitle();
     $fields['LABEL_JOBTITLE'] = $tr->getJobtitle();
     $fields['JOBTITLEDESCRIPTION'] = $tr->getJobtitledescription();
     $fields['LABEL_JOBTITLEDESCRIPTION'] = $tr->getJobtitledescription();
  }
  else
    $fields = array();

  $G_MAIN_MENU = 'workflow';
  $G_SUB_MENU = 'hrJobsTitles';
  $G_ID_MENU_SELECTED = '';
  $G_ID_SUB_MENU_SELECTED = '';


  $G_PUBLISH = new Publisher;
  $G_PUBLISH->AddContent('xmlform', 'xmlform', 'hr/hrJobsTitlesDelete', '', $fields, 'hrJobsTitlesDeleteExec' );
  G::RenderPage('publish', 'blank');
?>